package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import biz.AnnounceBiz;
import dao.AnnounceDao;
import entity.Announce;
import entity.Car;

public class AnnounceBizImpl implements AnnounceBiz {
	private AnnounceDao announceDao;
	
	
	public List<Announce> findByPage(Integer pageNo, Integer rows) {
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return announceDao.findByPage(map);
	}
	
	public List<Announce> findAll() {
		return announceDao.findAll();
	}

	public Announce findById(Integer id) {
		return announceDao.findById(id);
	}

	public int add(Announce announce) {
		return announceDao.add(announce);
	}

	public int delete(Announce announce) {
		return announceDao.delete(announce);
	}

	public int update(Announce announce) {
		return announceDao.update(announce);
	}

	public List<Announce> findByParam(Map map) {
		return null;
	}


	public Integer count() {	
		return announceDao.count();
	}

	public AnnounceDao getAnnounceDao() {
		return announceDao;
	}

	public void setAnnounceDao(AnnounceDao announceDao) {
		this.announceDao = announceDao;
	}
	
}
